home *** CD-ROM | disk | FTP | other *** search
/ SGI Desktop Special Edition 1.1 / SGI Desktop Special Edition 1.1.iso / dist / SoftWindows2.idb / usr / lib / SoftWindows2 / bin / scripts / view_hints.sh.z / view_hints.sh
Encoding:
Linux/UNIX/POSIX Shell Script  |  1995-11-13  |  1.5 KB  |  61 lines

  1. #!/bin/sh
  2. #                       SCF - SwinConFiguration filename
  3. #                       SAV- name of Saved file.
  4. #                       SYS- name of System wide configuration defaults file.
  5. SCF=$HOME/.swin2config
  6. SAV=$SCF.pre2.00
  7. SYS=$SWIN2HOME/sys.swin2config
  8. HINTS=$SWIN2HOME/swin_hints 
  9. HINTS_HTML=$SWIN2HOME/swin_hints.html
  10. VIEWED=$SWIN2HOME/swin_hints_viewed
  11. FGREP=/usr/bin/fgrep
  12. GREP=/sbin/grep
  13. UNAME=/sbin/uname
  14. XCONFIRM=/usr/bin/X11/xconfirm
  15. CAT=/sbin/cat
  16. CPIO=/sbin/cpio
  17. AWK=/usr/bin/awk
  18. FIND=/sbin/find
  19. SED=/sbin/sed
  20. PS=/sbin/ps
  21. SLEEP=/sbin/sleep
  22. NETSCAPE=/usr/bin/X11/netscape
  23. CSH=/sbin/csh
  24.  
  25. # The following displays swin_hints if they haven't been seen
  26. # by this user before, or if the sysadmin clears the user's
  27. # name from the $VIEWED file (because the hints have changed).
  28.  
  29. # Note that if licensing needs to be done, the hints come up
  30. # on top of the licensing window.  Not on top of the DOS or
  31. # MS-windows window.
  32.  
  33. if $FGREP -s $USER $VIEWED ; then
  34.     exit 0;
  35. fi
  36.  
  37. $CSH -f $SWIN2HOME/bin/scripts/user_env.sw
  38.  
  39. ( if [ -r $HINTS ] ; then
  40.     WAIT=5
  41.     while [ $WAIT -gt 0 ]
  42.     do
  43.         $SLEEP 2
  44.         PROC=`$PS -e | $AWK '{ print $4 }' | $GREP swin | $GREP -v grep`
  45.         if [ "$PROC" = "" ] ; then
  46.             WAIT=`expr $WAIT - 1`
  47.         else
  48.             WAIT=0
  49.         fi
  50.     done
  51.     $SLEEP 5
  52.     if [ -r $HINTS_HTML -a -x $NETSCAPE ] ; then
  53.             $NETSCAPE $HINTS_HTML & 
  54.     else
  55.         dd=`$XCONFIRM -c -B Ok -file $HINTS \
  56.              -header "SoftWindows Usage Hints" -useslider &`
  57.     fi
  58.     echo $USER >>$VIEWED
  59. fi ) &
  60. exit 0;
  61.